import os

demo_path = "/usr/local/src/reward/"

# go rpc
rpc_path = demo_path + "server-go/rpc/reward/"
os.chdir(rpc_path)
rpc_start = "nohup ./server-rpc -f etc/conf.yaml >> /usr/local/src/log/server-rpc.log 2>&1 &"
os.system(rpc_start)

# go api
api_path = demo_path + "server-go/api/reward/"
os.chdir(api_path)
api_start = "nohup ./server-api -f etc/conf.yaml >> /usr/local/src/log/server-api.log 2>&1 &"
os.system(api_start)

# flask
py_path = demo_path + "server-py/"
os.chdir(py_path)
py_start = "nohup python ./app.py >> /usr/local/src/log/server-py.log 2>&1 &"
os.system(py_start)
